#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstring>
using namespace std;
const int N = 5010, M = 20010;
int h[N], e[M], ne[M], idx;
int stk[N], top, edcc_cnt, timestamp;
int dfn[N], low[N], id[N], degree[N];
bool is_bridge[N];
int n, m;
void add(int a, int b)
{
    e[idx] = b, ne[idx] = h[a], h[a] = idx++;
}
void tarjan(int u, int from)
{
    dfn[u] = low[u] = ++timestamp;
    stk[++top] = u;
    for (int i = h[u]; ~i; i = ne[i])
    {
        int j = e[i];
        if (!dfn[j])
        {
            tarjan(j, i);
            low[u] = min(low[u], low[j]);
            if (dfn[u] < low[j]) is_bridge[i] = is_bridge[i ^ 1] = true;
        }
        else if (i != (from ^ 1))
        {
            low[u] = min(low[u], dfn[j]);
        }
    }
    if (dfn[u] == low[u])
    {
        int y;
        edcc_cnt++;
        do
        {
            y = stk[top--];
            id[y] = edcc_cnt;
        } while (y != u);
    }
}
int main()
{
    memset(h, -1, sizeof h);
    cin >> n >> m;
    for (int i = 0; i < m; i++)
    {
        int a, b;
        cin >> a >> b;
        add(a, b), add(b, a);
    }
    tarjan(1, -1);
    for (int i = 0; i < idx; i++)
    {
        int j = e[i];
        if (is_bridge[i]) degree[id[j]]++;
    }
    int cnt = 0;
    for (int i = 1; i <= edcc_cnt; i++)
    {
        if (degree[i] == 1) cnt++;
    }
    cout << (cnt + 1) / 2 << endl;
    return 0;
}